const mongoose = require('mongoose');

const iconSchema = new mongoose.Schema({
  text: {
    type: String,
    required: true,
    maxlength: 30
  },
  image: {
    type: String,
    required: true
  },
  category: {
    type: String,
    required: true,
    index: true // 为分类字段添加索引
  },
  createdAt: {
    type: Date,
    default: Date.now
  }
});

module.exports = mongoose.model('Icon', iconSchema);